#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5;
int n,m,K,son[N],u,v,x,vis[N],wyt[N],len,b[N],c[N],f[N],de[N],top[N],siz[N];
vector <int> e[N];
void dfs(int u,int fa){
	siz[u]=1;b[u]=1;
	if(vis[u])c[++len]=u;
	for(int i = 0;i < e[u].size();i++){
		int v=e[u][i];
		if(v==fa)continue;
		de[v]=de[u]+1,f[v]=u,dfs(v,u),siz[u]+=siz[v];
		son[u]=(siz[son[u]]<siz[v]?v:son[u]);
	}
}
void dfs1(int u,int fa){
	top[u]=fa;
	if(son[u])dfs1(son[u],fa);
	for(int i= 0;i < e[u].size();i++){
		int v=e[u][i];
		if(v==f[u]||v==son[u])continue;
		dfs1(v,v);
	}
}
int lca(int x,int y){
	while(top[x]!=top[y]){
		if(de[top[x]]<de[top[y]])swap(x,y);
		x=f[top[x]];
	}return (de[x]<de[y]?x:y);
}int d[N],tlh[N];
vector <int> answer[N];int ans;
void work(int rt){
	len=0,dfs(rt,0),dfs1(rt,rt);
	for(int i = 1;i <= len;i+=2){
		if(i+1<=len){
			int lca1=lca(c[i],c[i+1]);
			int len2=0,len1=0,x=c[i],y=c[i+1];
			while(x!=lca1){
				d[++len1]=x;
				x=f[x];
			}d[++len1]=x;
			while(y!=lca1){
				tlh[++len2]=y;
				y=f[y];
			}ans++;
			for(int j = 1;j <= len1;j++)answer[ans].push_back(d[j]);
			for(int j = len2;j >= 1;j--)answer[ans].push_back(tlh[j]);
		}
	}
}int ft[N];
int getf(int u){
	if(ft[u]==u)return u;
	return ft[u]=getf(ft[u]);
}
signed main(){
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin >> n >> m >> K;
	for(int i = 1;i <= n;i++)ft[i]=i;
	for(int i = 1;i <= m;i++){
		cin >> u >> v;
		if(getf(u)!=getf(v)){
			e[u].push_back(v);
			e[v].push_back(u);
			ft[getf(u)]=getf(v);
		}
	}
	for(int i = 1;i <= K;i++)cin >> x,vis[x]=1;//cout << "shit\n";
	for(int i = 1;i <= n;i++){
		if(!b[i]){
			work(i);
		}
	}
/*	for(int i = 1;i <= ans;i++){
		int x= answer[i][0],y =answer[i][answer[i].size()-1];
		if(i==13||i==14){
			cout << x << " " << y << " " <<lca(x,y) << "\n";
		}
		if(x==y){
			cout << "false\n";
			return 0;
		}
		int lca1=lca(x,y);
		while(x!=lca1){
			if(wyt[x]){
				cout <<i << " " << x << " " << wyt[x] << " path is false\n";
				return 0;
			}wyt[x]=i,x=f[x];
		}
		while(y!=lca1){
			if(wyt[y]){
				cout <<i << " " << y << " " <<wyt[y] <<  " path is false\n";
				return 0;
			}wyt[y]=i,y=f[y];
		}
	}*/
	cout <<  ans << "\n";
	for(int i = 1;i <= ans;i++){
		cout << answer[i].size() << " ";
		for(int j = 0;j < answer[i].size();j++)cout << answer[i][j] << " ";cout << "\n";
	}
//	cout << "no problem\n";
	return 0;
}

